<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body onclick="show()">
        <a>aa</a>
        <p>pp</p>
        <span>span</span>
        <h1>h1</h1>
        <div>div</div>
    
</body>
<script>
    function show(){
       var obj=event.srcElement;//事件源对象
        alert(obj.tagName);
    }
</script>
</html>